<%--
  Created by IntelliJ IDEA.
  User: 29276
  Date: 2021/8/15
  Time: 13:22
  To change this template use File | Settings | File Templates.
--%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    //http://localhost:8080/01_sxtoa_war_exploded/
%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <base href="<%=basePath%>"/>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    <link href="css/style.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript">
        $(function () {
            $("#btn").click(function () {
                const reqData = {
                    deptNo:$("#deptNo").val(),
                    deptName:$("#deptName").val(),
                    location:$("#location").val(),
                    methodName:"deptConfirmUpdate"
                }
                console.log(reqData);
                $.post("deptServlet", reqData, function (data) {
                    if (data === "sessionTimeOut") {
                        window.location.href="login.jsp";
                        return;
                    }
                    if (data) {
                        alert("修改成功！");
                        //跳转页面
                        window.location.assign("personManager/deptList.jsp");
                    }
                    else {
                        alert("修改失败");
                    }
                })
            })
        })
    </script>
</head>

<body>

<div class="place">
    <span>位置：</span>
    <ul class="placeul">
        <li><a href="#">人事管理</a></li>
        <li><a href="#">修改部门</a></li>
    </ul>
</div>

<div class="formbody">

    <div class="formtitle"><span>基本信息</span></div>

    <ul class="forminfo">
        <li><label>部门编号</label><input id="deptNo" disabled name="" type="text" class="dfinput" value="${requestScope.dept.deptNo}" /> </li>
        <li><label>部门名称</label><input id="deptName" name="" type="text" class="dfinput" value="${requestScope.dept.deptName}" /> </li>
        <li><label>办公地点</label><input id="location" name="" type="text" class="dfinput" value="${requestScope.dept.location}" /></li>
        <li><label>&nbsp;</label><input id="btn" name="" type="button" class="btn" value="确认修改"/></li>
    </ul>


</div>


</body>

</html>
